﻿using System;

namespace Program09
{
    class Program
    {
        /// <summary>
        /// 使用递归实现1~n的求和
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine(Program.ThisAdd(4));
        }

        public static int ThisAdd(int n) 
        {
            if (n == 1) //限制条件
            
                return 1;

            return ThisAdd(n - 1) + n;//我调我自己
            
        }
    }
}
